package com.example.xyblog.mapper;

import com.example.xyblog.Model.Articleinfo;
import com.example.xyblog.Model.Userinfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {
    public int addUser(@Param("url") String url,
                       @Param("address") String address,
                       @Param("username") String username,
                       @Param("password") String password);

    /**
     * 登陆校验
     */
    public Userinfo loginChk(@Param("username")String username);

    /**
     * 计算文章总数
     */
    public List<Articleinfo> countBlogs(@Param("uid") Integer uid);


    /**
     * 根据uid来得到当前作者的信息
     */
    public Userinfo getUser(@Param("uid") Integer uid);
}
